package com.holike.crm.presenter.activity;

import com.holike.crm.base.BasePresenter;
import com.holike.crm.bean.MessageDetailsBean;
import com.holike.crm.http.RequestCallBack;
import com.holike.crm.model.activity.MessageDetailsModel;
import com.holike.crm.view.activity.MessageDetailsView;

public class MessageDetailsPresenter extends BasePresenter<MessageDetailsView, MessageDetailsModel> {

    /**
     * 获取消息详情
     */
    public void getMessageDetails(String messageId, String type) {
        if (getModel() != null) {
            getModel().getMessageDetails(messageId, type, new RequestCallBack<MessageDetailsBean>() {
                @Override
                public void onFailed(String failReason) {
                    if (getView() != null)
                        getView().getMessageDetailsFailed(failReason);
                }

                @Override
                public void onSuccess(MessageDetailsBean result) {
                    if (getView() != null)
                        getView().getMessageDetailsSuccess(result);
                }
            });
        }
    }
}
